<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../yl/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <title>留言信息</title>
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <div>
                留言人<el-input clearable v-model="page.value1" style="width: 200px; margin:0 10px;"
                    placeholder="请输入留言人"></el-input>
                <!-- 来源&nbsp;&nbsp;<el-select v-model="page.value2" filterable clearable
                    style="margin-right: 10px;width: 200px" placeholder="请选择留言来源">
                    <el-option label="党建板块" value="0"></el-option>
                    <el-option label="数智漠河" value="1"></el-option>
                </el-select> -->
                <el-button icon="Search" style="margin: 0; margin-right: 10px;" @click="check">查询</el-button>
                <el-button icon="Refresh" style="margin: 0; margin-right: 10px;" @click="reset">重置</el-button>
                <!-- <el-button type="success" icon="Upload" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导出</el-button>
                <el-button type="danger" icon="Delete" style="margin: 0; margin-right: 10px;" @click="personalAdd" plain
                    round>批量删除</el-button> -->
            </div>
        </div>
        <div class="body">
            <div class="right">
                <el-table id="table" border
                    :data-options="JSON.stringify({ 'TableName': 'message_board','primary_key':'Message_SerialNumber'})"
                    height="450" v-loading="loading" ref="multipleTable" tooltip-effect="dark" :data="Tabletdata"
                    @selection-change="handleSelectionChange">
                    <el-table-column min-width="200" show-overflow-tooltip  v-for="column in columns" :key="column.COLUMN_NAME"
                        :prop="column.COLUMN_NAME" :label="column.COLUMN_COMMENT">
                        <template v-slot="{row}">
                            <div v-if="isValueType(row[column.COLUMN_NAME])=='image'">
                                <el-image style="width: 100px; height: 100px" :src="photo + row[column.COLUMN_NAME]"
                                    fit="contain"></el-image>
                            </div>
                            <template v-else>
                                {{row[column.COLUMN_NAME]}}
                            </template>
                        </template>
                    </el-table-column>
                    <el-table-column width="90" fixed="right" align="center" label="状态">
                        <template v-slot="{row}">
                            <el-tag :type="row.Create_Comment_Datetime==''?'danger':'success'">{{row.Create_Comment_Datetime==''?'未回复':'已回复'}}</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" fixed="right" width="170">
                        <template #default="{row}">
                            <div style="display: flex; align-items: center;">
                                <el-button size="small" :disabled="row.Create_Comment_Datetime != ''" :type="row.Create_Comment_Datetime == ''?'success':'info'" style="margin-right: 10px;" @click="handlehf(row)">
                                    回复
                                </el-button>
                                <el-dropdown trigger="click">
                                    <el-button size="small">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item @click="handleShow(row)">
                                                查看详情
                                            </el-dropdown-item>
                                            <!-- <el-dropdown-item @click="handleShow1(row)">
                                                查看附件
                                            </el-dropdown-item> -->
                                            <el-dropdown-item @click="handleDelete(row)">
                                                删除
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown>
                            </div>

                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination style="margin-top: 1%;" :current-page="page.PageNumber" :page-size="page.RowAmount"
                    :page-sizes="[20, 100, 200, 300, 400]" layout="total, sizes, prev, pager, next, jumper"
                    :total="Total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div>
        </div>
        <el-dialog v-model="showDialog1" :destroy-on-close="true" width="700" :close-on-click-modal="false"
            class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>留言回复</span>
                </div>
            </template>
            <el-form :model="form" ref="form" :inline-message="true" style="width: 100%">
                <div style="display: flex;" class="flex">
                    <el-descriptions style="width: 100%;margin-left: 10px;" :column="1" size="large" border>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">回复内容</div>
                            </template>
                            <el-form-item style="margin-bottom: 0;" prop="Comment_Content"
                                :rules="[{ required: true, message: '请输入回复内容', trigger: 'blur' }]">
                                <el-input style="width: 100%;" type="textarea" :autosize="{ minRows: 6}"
                                    v-model="form.Comment_Content" class="borderless-input" placeholder="请输入回复内容" />
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </div>
            </el-form>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog1 = false" class="cancel-btn">取消</el-button>
                    <el-button type="primary" @click="handleSubmit" class="confirm-btn"
                        :loading="loading">确认</el-button>
                </div>
            </template>
        </el-dialog>
        <el-dialog v-model="showDialog2" :destroy-on-close="true" width="900" :close-on-click-modal="false"
            class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>查看附件</span>
                </div>
            </template>
            <el-table id="table" border max-height="450" tooltip-effect="dark" :data="message_board_attachment">
                <el-table-column min-width="180" prop="Attachment_SerialNumber" label="附件流水号"></el-table-column>
                <el-table-column min-width="180" prop="Attachment_Path" label="附件名称"></el-table-column>
                <el-table-column width="200" fixed="right" align="center" label="操作">
                    <template v-slot="{row}">
                        <el-button type="primary" size="small" @click="preview(row)">
                            在线预览
                        </el-button>
                        <el-button type="success" size="small" @click="download(row)">
                            下载附件
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog2 = false" class="cancel-btn">取消</el-button>
                </div>
            </template>
        </el-dialog>
        <yl-online-preview :file-url="fileUrl" v-model="showDialog"></yl-online-preview>
    </div>
    </div>
    <script src="../../../utils/utils.js"></script>
    <script src="../../../config/config.js"></script>
    <script src="../../../utils/mixins.js"></script>
    <script src="../../../yl/vue.js"></script>
    <script src="../../../yl/index.js"></script>
    <script src="../../../yl/zh-cn.mjs"></script>
    <script src="../../../yl/index.iife.min.js"></script>
    <script src="../../../yl/jquery.min.js"></script>
    <script src="../../../utils/jquery.cookie.js"></script>
    <script src="../../../api/request.js"></script>
    <script src="js/index.js"></script>
</body>

</html>